<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">
<link rel="stylesheet" href="css/vivo.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="js/bootstrap2/css/bootstrap.min.css">
<link rel="stylesheet" href="js/bootstrap2/css/bootstrap-table.css">
<link rel="stylesheet" href="css/common.css">
<link href="js/select2/select2.min.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="js/webuploader-0.1.5/webuploader.css" />

<script src="js/jquery-1.11.1.js"></script>
<script src="js/bootstrap2/js/bootstrap.min.js"></script>

<script src="js/bootstrap2/js/bootstrap-table.js"></script>
<script src="js/bootstrap2/js/bootstrap-table-zh-CN.js"></script>
<script src="js/select2/select2.min.js"></script>
<script type="text/javascript" src="<%=basePath%>js/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="js/webuploader-0.1.5/webuploader.js"></script>
<script type="text/javascript" src="js/layui-v2.1.5/layui/layui.all.js"></script> 
<script type="text/javascript" src="js/sharefunction.js"></script> 
<script type="text/javascript" src="js/form.js"></script> 
<!-- 图片放大 -->
<script src="js/postbird-img-glass/postbird-img-glass.js" ></script>
<title>地面审批</title>
<style type="text/css">
.main-top tr {
	height: 35px;
}

.leftt {
	text-align: center;
	width: 80px
}

.neirong {
	width: 220px;
}

input[type="search"], input[type="text"] {
	height: 30px;
	margin-bottom: 0px;
	width: 200px
}

.mingcheng {
	display: -moz-inline-box;
	display: inline-block;
	width: 100px;
}

.select2-container .select2-selection--single {
	height: 30px
}

</style>
</head>
<script type="text/javascript">

$(function() {
	//禁用表单
	hideButton();
	//根据房间类型隐藏字段值
	hideColumn('${floor.roomType}');
	//附件赋值
	decorationLandGetFile();
	//悬浮提示
	toolTip();
	//修改字段标记记录变量
	<c:set var="marks" value="原数据"/>
});

function save(opt){
	var url = "customer/floor/disposeFloor";
	var apId = '${requestScope.apId }';
	var exDataId = '${exDataId}';
	var approvalRemark = $("textarea[name='approvalRemark']").val();
	var formData = {
			exDataId:exDataId,
        	opt:opt,
        	apId:apId,
        	approvalRemark:approvalRemark
    };
	disposeSave(opt,url,formData);
}

</script>
<body>
	<div class="contentt" style="min-height: 550px;">
		<form class="cmxform" id="CheckReceiveFloorAddForm" method="post"
			action="customer/floor/add">
			<input type="hidden" id="checkReceiveFloorAdd_articleId">
			<div class="top" style="border-bottom: 1px solid gray;height: 35px;margin-bottom: 15px">
				<span class="style_btn" style="width:100px;">地面</span>
				<span style="width: 60px;margin-left:37px;height:30px;line-height:30px;">房屋类型</span>
				<span style="width:60px;height:30px;margin-left:10px;line-height:30px;">
					<select name="roomType" id="roomType" style="width:80px">
						<option value="${floor.roomType}" selected="selected">${floor.roomType}</option>
					</select>
				</span>
			</div>
			<div class="main-top">
				<div style="width: 100%;">
					<table width="100%">
						<tr>
							<td class="leftt"><span class="style_btn"
								style="width:100px;">装饰材料</span></td>
							<td width="360">
								<select id="decorativeMaterials" name="decorateMaterials" style="width:150px;">
									<option value="${floor.decorateMaterials}" selected="selected" >${floor.decorateMaterials}</option>
								</select>
								<c:if test="${not empty requestScope.map.decorateMaterials }"><span class="toolTip mark-msg"data-tip="${requestScope.map.decorateMaterials }">
									<c:out value="${marks}"/></span>
								</c:if>
								<c:if test="${requestScope.map.decorateMaterials=='' }"><span class="toolTip mark-msg"data-tip="空">
									<c:out value="${marks}"/></span>
								</c:if>
							</td>

							<td
								class="leftt xuanguanHide cantingHide chufangHide chuwujianHide weishengjianHide yangtaiHide pingtaiHide"><span
								class="style_btn" style="width:100px;">楼梯</span></td>
							<td width="360"
								class="xuanguanHide cantingHide chufangHide chuwujianHide weishengjianHide yangtaiHide pingtaiHide">
								<select id="stairMaterial" name="stairsMaterials" style="width:150px;">
									<option value="${floor.stairsMaterials }" selected="selected" >${floor.stairsMaterials }</option>
								</select>
								<c:if test="${not empty requestScope.map.stairsMaterials }"><span class="toolTip mark-msg"data-tip="${requestScope.map.stairsMaterials }">
									<c:out value="${marks}"/></span>
								</c:if>
								<c:if test="${requestScope.map.stairsMaterials=='' }"><span class="toolTip mark-msg"data-tip="空">
									<c:out value="${marks}"/></span>
								</c:if>
							</td>
						</tr>
						<tr>
							<td class="leftt"></td>
							<td><input type="text" name="decorateMaterialsInfo" value="${floor.decorateMaterialsInfo }">
								<c:if test="${not empty requestScope.map.decorateMaterialsInfo }"><span class="toolTip mark-msg"data-tip="${requestScope.map.decorateMaterialsInfo }">
									<c:out value="${marks}"/></span>
								</c:if>
								<c:if test="${requestScope.map.decorateMaterialsInfo=='' }"><span class="toolTip mark-msg"data-tip="空">
									<c:out value="${marks}"/></span>
								</c:if>
								<!-- 地面_装饰材料  上传按钮 -->
								<div id='filePicker_zscl' style="display:none">上传</div>
							</td>
							<td class="leftt  xuanguanHide cantingHide chufangHide chuwujianHide weishengjianHide yangtaiHide"></td>
							<td class="xuanguanHide pingtaiHide cantingHide chufangHide chuwujianHide weishengjianHide yangtaiHide">
								<input type="text" name="stairsMaterialsInto" value="${floor.stairsMaterialsInto }"> 
								<c:if test="${not empty requestScope.map.stairsMaterialsInto }"><span class="toolTip mark-msg"data-tip="${requestScope.map.stairsMaterialsInto }">
									<c:out value="${marks}"/></span>
								</c:if>
								<c:if test="${requestScope.map.stairsMaterialsInto=='' }"><span class="toolTip mark-msg"data-tip="空">
									<c:out value="${marks}"/></span>
								</c:if>
								<!--地面_楼梯材料 上传按钮 -->
								<div id='filePicker_ltcl' style="display:none">上传</div>
							</td>
						</tr>
						<tr valign="top" >
							<td colspan="2" width="50%">
								<!-- 附件上传 地面_装饰材料。。。--> <!-- 缩略图容器 -->
								<div id='list_zscl'></div>
							</td>
							<td colspan="2" width="50%" class="pingtaiHide">
								<!-- 附件上传 地面_楼梯材料。。。--> <!-- 缩略图容器 -->
								<div id='list_ltcl'></div>
							</td>
						</tr>
						<tr class="pingtaiHide">
							<td class="leftt yangtaiHide"><span class="style_btn "
								style="width:100px;">地面承载</span></td>
							<td class="yangtaiHide"><input type="text" name="floorLoad" value="${floor.floorLoad }">
								<c:if test="${not empty requestScope.map.floorLoad }"><span class="toolTip mark-msg"data-tip="${requestScope.map.floorLoad }">
									<c:out value="${marks}"/></span>
								</c:if>
								<c:if test="${requestScope.map.floorLoad=='' }"><span class="toolTip mark-msg"data-tip="空">
									<c:out value="${marks}"/></span>
								</c:if>
								<!-- 地面_地面承载 上传按钮 -->
								<div id='filePicker_dmcz' style="display:none">上传</div>
							</td>

							<td class="leftt">
								<span class="style_btn xuanguanHide " style="width:100px;">地板采暖</span>
							</td>
							<td class="xuanguanHide">
								<input type="text" name="floorHeating" value="${floor.floorHeating }"> 
								<c:if test="${not empty requestScope.map.floorHeating }"><span class="toolTip mark-msg"data-tip="${requestScope.map.floorHeating }">
									<c:out value="${marks}"/></span>
								</c:if>
								<c:if test="${requestScope.map.floorHeating=='' }"><span class="toolTip mark-msg"data-tip="空">
									<c:out value="${marks}"/></span>
								</c:if>
								<!--地面_地面采暖 上传按钮 -->
								<div id='filePicker_dbcn' style="display:none">上传</div>
							</td>
						</tr>
						<tr class=" pingtaiHide">
							<td colspan="2" class="yangtaiHide">
								<!-- 附件上传 地面_地面承载。。。  --> <!-- 缩略图容器 -->
								<div id='list_dmcz'></div>
							</td>
							<td colspan="2" class="xuanguanHide">
								<!-- 附件上传 地面_地面采暖。。。  --> <!-- 缩略图容器 -->
								<div id='list_dbcn'></div>
							</td>
						</tr>
						<tr
							class="xuanguanHide chufangHide weishengjianHide yangtaiHide pingtaiHide">
							<td class="leftt"><span class="style_btn"
								style="width:100px;">地面插座</span></td>
							<td></td>

						</tr>
						<tr class="xuanguanHide chufangHide yangtaiHide pingtaiHide">
							<td class="leftt">电源</td>
							<td><input type="text" name="powerSocket" value="${floor.powerSocket }"> 
								<c:if test="${not empty requestScope.map.powerSocket }"><span class="toolTip mark-msg"data-tip="${requestScope.map.powerSocket }">
									<c:out value="${marks}"/></span>
								</c:if>
								<c:if test="${requestScope.map.powerSocket=='' }"><span class="toolTip mark-msg"data-tip="空">
									<c:out value="${marks}"/></span>
								</c:if>
								<!--地面_电源 上传按钮 -->
								<div id='filePicker_dy' style="display:none">上传</div></td>

							<td class="leftt">电话</td>
							<td><input type="text" name="phoneSocket" value="${floor.phoneSocket }"> 
								<c:if test="${not empty requestScope.map.phoneSocket }"><span class="toolTip mark-msg"data-tip="${requestScope.map.phoneSocket }">
									<c:out value="${marks}"/></span>
								</c:if>
								<c:if test="${requestScope.map.phoneSocket=='' }"><span class="toolTip mark-msg"data-tip="空">
									<c:out value="${marks}"/></span>
								</c:if>
								<!-- 电话上传按钮 -->
								<div id='filePicker_dh' style="display:none">上传</div></td>

						</tr>
						<tr  class="chufangHide yangtaiHide pingtaiHide">
							<td colspan="2">
								<!-- 附件上传 地面_电源。。。  --> <!-- 缩略图容器 -->
								<div id='list_dy'></div>
							</td>

							<td colspan="2">
								<!-- 附件上传 地面_电话。。。 缩略图容器 --> <!--缩略图容器-->
								<div id='list_dh'></div>
							</td>
						</tr>
						<tr class="xuanguanHide chufangHide yangtaiHide pingtaiHide">
							<td class="leftt">网络</td>
							<td><input type="text" name="networkSocket" value="${floor.networkSocket }"> 
								<c:if test="${not empty requestScope.map.networkSocket }"><span class="toolTip mark-msg"data-tip="${requestScope.map.networkSocket }">
									<c:out value="${marks}"/></span>
								</c:if>
								<c:if test="${requestScope.map.networkSocket=='' }"><span class="toolTip mark-msg"data-tip="空">
									<c:out value="${marks}"/></span>
								</c:if>
								<!-- 地面_网络 上传按钮 -->
								<div id='filePicker_wl' style="display:none">上传</div></td>

							<td class="leftt">音频</td>
							<td><input type="text" name="voiceSocket" value="${floor.voiceSocket }"> 
								<c:if test="${not empty requestScope.map.voiceSocket }"><span class="toolTip mark-msg"data-tip="${requestScope.map.voiceSocket }">
									<c:out value="${marks}"/></span>
								</c:if>
								<c:if test="${requestScope.map.voiceSocket=='' }"><span class="toolTip mark-msg"data-tip="空">
									<c:out value="${marks}"/></span>
								</c:if>
								<!-- 地面_音频 上传按钮 -->
								<div id='filePicker_yp' style="display:none">上传</div></td>
						</tr>
						<tr class="chufangHide yangtaiHide pingtaiHide">
							<td colspan="2">
								<!-- 附件上传 地面_网络。。。  --> <!-- 缩略图容器 -->
								<div id='list_wl'></div>
							</td>

							<td colspan="2">
								<!-- 附件上传 地面_音频。。。  --> <!-- 缩略图容器 -->
								<div id='list_yp'></div>
							</td>
						</tr>
						<tr class="xuanguanHide chufangHide yangtaiHide pingtaiHide">
							<td class="leftt">视频</td>
							<td><input type="text" name="videoSocket" value="${floor.videoSocket }"> 
								<c:if test="${not empty requestScope.map.videoSocket }"><span class="toolTip mark-msg"data-tip="${requestScope.map.videoSocket }">
									<c:out value="${marks}"/></span>
								</c:if>
								<c:if test="${requestScope.map.videoSocket=='' }"><span class="toolTip mark-msg"data-tip="空">
									<c:out value="${marks}"/></span>
								</c:if>
								<!--地面_视频 上传按钮 -->
								<div id='filePicker_sp' style="display:none">上传</div></td>

						</tr>
						<tr  class="chufangHide yangtaiHide pingtaiHide">
							<td colspan="2">
								<!-- 附件上传 地面_视频。。。  --> <!-- 缩略图容器 -->
								<div id='list_sp'></div>
							</td>

						</tr>

						<tr class="xuanguanHide qijushiHide cantingHide chuwujianHide ">
							<td class="leftt pingtaiHide"><span class="style_btn"
								style="width:100px;">地漏</span></td>
							<td class="pingtaiHide">
								<input type="text" name="floorFunnel" value="${floor.floorFunnel }"> 
								<c:if test="${not empty requestScope.map.floorFunnel }"><span class="toolTip mark-msg"data-tip="${requestScope.map.floorFunnel }">
									<c:out value="${marks}"/></span>
								</c:if>
								<c:if test="${requestScope.map.floorFunnel=='' }"><span class="toolTip mark-msg"data-tip="空">
									<c:out value="${marks}"/></span>
								</c:if>
								<!-- 地漏上传按钮 -->
								<div id='filePicker_dLcz' style="display:none">上传</div>
							</td>

							<td class="leftt chufangHide weishengjianHide"><span
								class="style_btn" style="width:100px;">排水口</span></td>
							<td class="chufangHide weishengjianHide">
								<input type="text" name="floorDrain" value="${floor.floorDrain }"> 
								<c:if test="${not empty requestScope.map.floorDrain }"><span class="toolTip mark-msg"data-tip="${requestScope.map.floorDrain }">
									<c:out value="${marks}"/></span>
								</c:if>
								<c:if test="${requestScope.map.floorDrain=='' }"><span class="toolTip mark-msg"data-tip="空">
									<c:out value="${marks}"/></span>
								</c:if>
								<!--地面_排水口 上传按钮 -->
								<div id='filePicker_drcz' style="display:none">上传</div>
							</td>
						</tr>
						<tr valign="top" class="xuanguanHide qijushiHide cantingHide chuwujianHide ">
							<td colspan="2" width="50%" class="pingtaiHide">
								<!-- 附件上传 地漏。。。--> <!-- 缩略图容器 -->
								<div id='list_dLcz'></div>
							</td>
							<td colspan="2" width="50%" class="chufangHide weishengjianHide">
								<!-- 附件上传 排水口。。。--> <!-- 缩略图容器 -->
								<div id='list_drcz'></div>
							</td>
						</tr>
					</table>
				</div>
				<input name="proofreadId" id="entityId_id" value="${id}" hidden="hidden"/>
				<input type="hidden" id="apId" name="apId" value="${requestScope.apId }"/>
				<c:if test="${requestScope.notPassExamine}">
					<!-- 修改时添加变更说明 -->
					<div style="margin:10px;" id="approvalRemark">
						审批意见<textarea rows="3" name="approvalRemark"style="width:70%"></textarea><span style="color:red;">*</span>
					</div>
					<div style="width:100%;text-align:center; padding-top:0px">
						<button class="btn btn-danger radius my-btn"
							onclick="save(0)" type="button">同意</button>
						<button class="btn btn-default radius"
							onclick="save(1)" type="button">拒绝</button>
					</div>
				</c:if>
			</div>
			<!-- main end  -->
		</form>
	</div>
	<!--contentt end  -->
	<script type="text/javascript">
		function hideButton(){
			//锁定表单数据
			$("#CheckReceiveFloorAddForm input").attr("readonly", true);
			$("#CheckReceiveFloorAddForm").find("select").attr("disabled", true);
			$("#CheckReceiveFloorAddForm div[id^='filePicker_']").css("display", "none");
		}
		
		//获取地面文件数据
		function decorationLandGetFile() {
			var id = '${id}';
			getFileListByFlag(id, "装修验收地面_装饰材料",2, "#list_zscl",setProofRFL, imgPlus);
			getFileListByFlag(id, "装修验收地面_地面承载",2, "#list_dmcz",setProofRFL, imgPlus);
			getFileListByFlag(id, "装修验收地面_地板采暖",2, "#list_dbcn",setProofRFL, imgPlus);
			getFileListByFlag(id, "装修验收地面_电源",2, "#list_dy",setProofRFL, imgPlus);
			getFileListByFlag(id, "装修验收地面_电话",2, "#list_dh",setProofRFL, imgPlus);
			getFileListByFlag(id, "装修验收地面_网络",2, "#list_wl",setProofRFL, imgPlus);
			getFileListByFlag(id, "装修验收地面_音频",2, "#list_yp",setProofRFL, imgPlus);
			getFileListByFlag(id, "装修验收地面_视频",2, "#list_sp",setProofRFL, imgPlus);
			getFileListByFlag(id, "装修验收地面_楼梯材料",2, "#list_ltcl",setProofRFL, imgPlus);
			getFileListByFlag(id, "装修验收地面_地漏", 2,"#list_dLcz",setProofRFL, imgPlus);
			getFileListByFlag(id, "装修验收地面_排水口",2, "#list_drcz",setProofRFL, imgPlus);
			<c:if test="${requestScope.notPassExamine}"> 
			//编辑新加的图片数据
			var fileCas=${requestScope.caList};
			if(fileCas.length > 0){
				var zscl = "";//装修验收地面_装饰材料
				var dmcz = "";//装修验收地面_地面承载
				var dbcn = "";//装修验收地面_地板采暖
				var dy = "";//装修验收地面_电源
				var dh = "";//装修验收地面_电话
				var wl = "";//装修验收地面_网络
				var yp = "";//装修验收地面_音频
				var sp = "";//装修验收地面_视频
				var ltcl = "";//装修验收地面_楼梯材料
				var dLcz = "";//装修验收地面_地漏
				var drcz = "";//装修验收地面_排水口
				for(var i=0;i<fileCas.length;i++){
					if(fileCas[i].articleId == "装修验收地面_装饰材料"){
						zscl += (","+fileCas[i].accessoryCAId);
					}else if(fileCas[i].articleId == "装修验收地面_地面承载"){
						dmcz += (","+ fileCas[i].accessoryCAId);
					}else if(fileCas[i].articleId == "装修验收地面_地板采暖"){
						dbcn += (","+ fileCas[i].accessoryCAId);
					}else if(fileCas[i].articleId == "装修验收地面_电源"){
						dy += (","+ fileCas[i].accessoryCAId);
					}else if(fileCas[i].articleId == "装修验收地面_电话"){
						dh += (","+ fileCas[i].accessoryCAId);
					}else if(fileCas[i].articleId == "装修验收地面_网络"){
						wl += (","+fileCas[i].accessoryCAId);
					}else if(fileCas[i].articleId == "装修验收地面_音频"){
						yp += (","+ fileCas[i].accessoryCAId);
					}else if(fileCas[i].articleId == "装修验收地面_视频"){
						sp += (","+ fileCas[i].accessoryCAId);
					}else if(fileCas[i].articleId == "装修验收地面_楼梯材料"){
						ltcl += (","+ fileCas[i].accessoryCAId);
					}else if(fileCas[i].articleId == "装修验收地面_地漏"){
						dLcz += (","+ fileCas[i].accessoryCAId);
					}else if(fileCas[i].articleId == "装修验收地面_排水口"){
						drcz += (","+ fileCas[i].accessoryCAId);
					}
				}
				if(zscl != ""){
					getFileTempList(zscl.substring(1),"#list_zscl", setProofRFL, imgPlus);
				}
				if(dmcz != ""){
					getFileTempList(dmcz.substring(1), "#list_dmcz", setProofRFL, imgPlus);
				}
				if(dbcn != ""){
					getFileTempList(dbcn.substring(1),"#list_dbcn", setProofRFL, imgPlus);
				}
				if(dy != ""){
					getFileTempList(dy.substring(1),"#list_dy", setProofRFL, imgPlus);
				}
				if(dh != ""){
					getFileTempList(dh.substring(1),"#list_dh", setProofRFL, imgPlus);
				}
				if(wl != ""){
					getFileTempList(wl.substring(1),"#list_wl", setProofRFL, imgPlus);
				}
				if(yp != ""){
					getFileTempList(yp.substring(1), "#list_yp", setProofRFL, imgPlus);
				}
				if(sp != ""){
					getFileTempList(sp.substring(1),"#list_sp", setProofRFL, imgPlus);
				}
				if(ltcl != ""){
					getFileTempList(ltcl.substring(1),"#list_ltcl", setProofRFL, imgPlus);
				}
				if(dLcz != ""){
					getFileTempList(dLcz.substring(1),"#list_dLcz", setProofRFL, imgPlus);
				}
				if(drcz != ""){
					getFileTempList(drcz.substring(1),"#list_drcz", setProofRFL, imgPlus);
				}
			}
			</c:if>
		}
		//本页面图片放大通用方法,同时隐藏上传按钮与图片删除按钮
		function imgPlus(data){
			$.each(data,function(i,v){
				PostbirdImgGlass.init({
			    	domSelector:"img",
			    	animation:true,
			    	//height:'80%',
			    	myDocument:window.parent.parent.parent
				});
			});
		}
	
		//图片删除按钮事件 landArray
		function setProofRFL(id,_this){
			layer.confirm('删除该图片？',{
				title:'警告',
				icon:0,
				shade:[0.1, '#fff']
			},function(){
				landArray.push(id);
				//删除指定缩略图
				$("#"+id).remove();
				layer.close(layer.index);
			});
		}
		
	</script>
</body>
</html>
